package com.aisile.shop.controller;

import com.aisile.pojo.TbItemCat;
import com.aisile.sellergoods.service.ItemCatService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("itemCat")
public class ItemCatController {
    @Reference
    ItemCatService itemCatService;

    @RequestMapping("findByParentId")
    public List<TbItemCat> findByParentId(long parentId){

        return itemCatService.findByParentId(parentId);
    }

    @RequestMapping("findOne")
    public  TbItemCat findOne(long id){

        return itemCatService.findOne(id);
    }
    @RequestMapping("findAll")
    public List<TbItemCat>  findAll(){

        return itemCatService.findAll();
    }
}
